
<div class="order-list-page" ng-if="pagedata.op == 'list'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">我的报名</div>
		<div class="fui-header-right"></div>
	</div>
	<div id="tab" class="fui-tab fui-tab-danger">
        <a ng-class="{'external active':pagedata.status==10}" href="javascript:" ng-click="access_json('list','status=10')">全部</a>
        <a ng-class="{'external active':pagedata.status == 0}" href="javascript:" ng-click="access_json('list','status=0')">待付款</a>
        <a ng-class="{'external active':pagedata.status == 1}" href="javascript:" ng-click="access_json('list','status=1')">待处理</a>
        <a ng-class="{'external active':pagedata.status == 2}" href="javascript:" ng-click="access_json('list','status=2')">已处理</a>
        <a ng-class="{'external active':pagedata.status == 3}" href="javascript:" ng-click="access_json('list','status=3')">已完成</a>
        <a ng-class="{'external active':pagedata.status == 4}" href="javascript:" ng-click="access_json('list','status=4')">已关闭</a>
    </div>
	<div class='fui-content navbar order-list' style="margin-top:2px">
	<div class="fui-list-group order-item" ng-repeat="item in pagedata.order_list">
                <a class="fui-list external" style="padding: 0.42rem 0.5rem" data-nocache="true">
                    <div class="fui-list-inner">
                        <div class="subtitle"> 单号: {{item.ordersn}}</div>
                    </div>
                    <div class="row-remark text-cancel" style="width: 4rem; font-size: 0.65rem;text-align: right;">{{item.statustitle}}</div>
                    <div class="angle"></div>
                </a> 
                    <a href="" data-nocache="true">
                        <div class="fui-list-group-title lineblock">
                            <i class="icon jinyunicon icon-dianpu"></i> {{item.store.title}}
                            <span ng-if="item.lesson.title" class="status noremark" style="font-size:0.50rem">课程：<span style="color:#f60;">{{item.lesson.title}}</span></span>
							<span ng-if="!item.lesson.title" class="status noremark" style="font-size:0.50rem">班级：<span style="color:#f60;">{{item.classgroup.title}}({{item.class.title}})</span></span>
                        </div>
                    </a>
                    <a href="" class="external" data-nocache="true" ng-click="access_json('jy_kexie/order/detail/id='+item.id)">
                        <div class="fui-list goods-list">
                            <div class="fui-list-media" style="">
                                <img ng-if="item.lesson.logo" class="" ng-src="{{tomedia(item.lesson.logo) || '../core/resource/images/nopic.jpg'}}">
								<img ng-if="!item.lesson.logo" class="" ng-src="{{tomedia(item.class.logo) || '../core/resource/images/nopic.jpg'}}">
							</div>
                            <div class="fui-list-inner">
                                <div class="text goodstitle towline">{{item.store.title}}</div>
								<div class="text overflow-h2" style="font-size:0.50rem">校区地址：<span style="color:red">{{item.store.pcd.city}}</span>({{item.store.pcd.district}} {{item.store.pcd.street}} {{item.store.address}})</div>
								<div class="text" style="color:#f60;font-size:0.50rem">报名学员：{{item.body.name}}({{item.body.sex==0?'女':'男'}})</div>
							</div>
                            <div class="fui-list-angle" style="width:auto">
                                ￥<span class="marketprice">{{item.money || '0.00'}}</span></div>
                        </div>
                    </a>
                <div class="fui-list-group-title lineblock">
					<span style="color:#999;font-size:0.55rem"><i class="icon jinyunicon icon-shijian" style="color:#f60;font-size:0.50rem"></i> {{item.createtime}}</span>
                    <span class="status noremark">共 <span>1</span> 个{{pagedata.diy.serve || '课程'}} 实付: <span class="text-danger">￥{{item.pay || item.money}}</span></span>
                </div>
            <div class="fui-list-group-title lineblock opblock">
				<span class="status noremark">
					<div ng-show="item.status == 0" class="btn btn-sm btn-default-o order-delete" href="javascript:" ng-click="post({},'del','id='+item.id)">删除报名</div>
					<div ng-show="item.status == 0" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="pay_submit({},'//pay/id='+item.id)">支付报名</div>
					<div ng-show="item.status == 2" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="post({},'receive','id='+item.id)">确认完成</div>
				</span>
            </div>
        </div>
	</div>
	<div class="content-empty" ng-show="pagedata.order_list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有约课！</p>
	</div>
	<div ng-include="sys_html('common/pluginnav',true)"></div>
</div>
<div class="order-list-page" ng-if="pagedata.op == 'detail'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">报名详情</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content member-page'>
		<div class="fui-list-group merchgroup">
			<div class="fui-list jump">
                <a class="fui-list-media">
                    <img class="round" src="{{tomedia(pagedata.order.body.avatar) || '../core/resource/images/nopic.jpg'}}" />
                </a>
                <div class="fui-list-inner">
                    <!--<div class="title">{{pagedata.user.name || '匿名学生'}}</div>-->
					<div class="title" style="font-size:0.65rem">学生姓名：{{pagedata.order.body.name}}</div>
					<div class="title" style="font-size:0.65rem">家长手机：{{pagedata.member.mobile}}</div>
					
                </div>
                <a class="jump" href="javascript:;">
					
				</a>
            </div>
		</div>
		<div class="weui_cells">
			<div ng-if="pagedata.order.lesson.title" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>课程名称</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.lesson.title}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>校区</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.store.title}}</div>
			</div>
			<div ng-if="pagedata.order.class.title" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>班级</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.classgroup.title}}({{pagedata.order.class.title}})</div>
			</div>
			<div ng-if="pagedata.order.classworker.name" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>班主任</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.classworker.name}}</div>
			</div>
			<div ng-if="pagedata.order.lessonworker.name" class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>任课老师</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.order.lessonworker.name}}</div>
			</div>
			
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>家长姓名</span>
					</div>
					<div class="weui_cell_ft">{{pagedata.member.nickname || '无'}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>家长电话</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.member.mobile">{{pagedata.member.mobile || '无'}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>报名日期</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.time">{{pagedata.order.createtime}}</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>备注</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.time">{{pagedata.order.remark || '无'}}</div>
			</div>
		<!--	<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>校区地址</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.address">{{pagedata.basic.address}}</div>
			</div>
			-->
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>费用</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.package_price">{{pagedata.order.money}}元</div>
			</div>
			<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>实际支付</span>
					</div>
					<div class="weui_cell_ft" ng-model="pagedata.post.package_price">{{pagedata.order.pay}}元</div>
			</div>
			<div class="weui_cell" ng-repeat="item in pagedata.fileds">
					<div ng-if="item.type != 3" class="weui_cell_bd weui_cell_primary">
						<span>{{item.title}}</span>
					</div>
					<div ng-if="item.type != 3" class="weui_cell_ft" ng-model="pagedata.post.package_price">{{item.data}}</div>
					<div ng-if="item.type == 3" class="weui_cell_bd weui_cell_primary">
						<span>{{item.title}}</span>
					</div>
					 <a class="fui-list-media" ng-if="item.type == 3">
                    <img class="round" src="{{tomedia(item.data) || '../core/resource/images/nopic.jpg'}}" />
                </a>
			</div>
		</div>
	</div>
	<div class="fui-footer" style="text-align: right;">
			<a class="l-f back" style="line-height: 2.5rem;padding: 0 .5rem;" ng-click="access_json('jy_kexie/order/list/');">报名列表</a>
					<div ng-show="pagedata.order.userdeleted!=1 && pagedata.order.status==0" ng-click="pagedata.checkcancel=true" class="btn btn-sm btn-default-o order-cancel">取消报名</div>
					<a ng-show="pagedata.order.userdeleted!=1 && pagedata.order.status==0 && pagedata.order.paytype!=3 && !pagedata.ispeerpay" class="btn btn-sm btn-red-o"  ng-click="pay_submit({},'//pay/id='+pagedata.order.id)">支付报名</a>
					<div ng-show="pagedata.order.status==3 || pagedata.order.status==-1" class="btn btn-sm btn-default-o order-delete" href="javascript:" ng-click="post({},'delete','id='+pagedata.order.id)">删除报名</div>
		
					<!--<a ng-show="pagedata.order.canrefund && pagedata.order.status!=1" data-nocache="true" class="btn btn-sm btn-default-o" href="javascript:" ng-click="access_json('jy_kexie/order.refund//id='+pagedata.order.id)" >申请售后</a>-->
					<a ng-show="pagedata.order.refundstate > 0 && pagedata.refund.status!=5" class='btn btn-sm btn-default-o btn-cancel'>取消申请</a>
				<div ng-show="pagedata.order.userdeleted==1" class="btn btn-sm btn-default-o order-deleted" href="javascript:" ng-click="post({},'rdelete','id='+pagedata.order.id)">彻底删除报名</div>
				<div ng-show="pagedata.order.userdeleted==1" class="btn btn-sm btn-default-o order-recover" href="javascript:" ng-click="post({},'reset','id='+pagedata.order.id)">恢复报名</div>
			
		</div>
</div>

<script type="text/javascript">

scope.pagedata.pay=function(id){
	var params={
		data:{'id':id},
		op:'pay',
		callback:function(res){
			if(res.payid){
				require(['tool'],function(tool){
					tool.pay(res.payid,function(res){
						if(res.type=='success'){
							scope.message('支付成功！','','jy_kexie/order//status=1');
							
						}else{
							scope.message('支付失败！失败原因：'+res.message,'error');
						}
					});
				});
			}
		}
	};
	scope.post_json(params);

}
</script>